<template>
  <div>
    <div class="header">
      <el-input placeholder="考试名称" v-model="input1" clearable> </el-input>
      <el-button type="primary" icon="el-icon-search">搜索</el-button>
    </div>
    <div class="body">
      <div class="lists">
        <div class="list" v-for="item in lists" :key="item.id">
          <strong>{{item.question}}</strong>
          <div>
            <label>题解数：</label><span>{{item.answer}}</span>
            <label>通过率：</label><span>{{item.pass}}</span>
            <label>难度：</label><span>{{item.difficult}}</span>
          </div>
          <div>
            <label>课程名：</label><span>{{item.subject}}</span>
            <label>标签：</label><span>{{item.tag}}</span>
            <label>出题人：</label><span>{{item.whomake}}</span>
          </div>
        </div>
      </div>
      <!-- {
          question: "5.最长回文子串",
          answer: "506",
          pass: "65.2%",
          difficult: "简单",
          subject: "离散数学",
          tag: "图论",
          whomake: "张学友",
        }, -->
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "questionAnalyse",
  data() {
    return {
      input1: "",
    };
  },
  computed: {
    ...mapState({
      lists: (state) => state.quesCollect.questions,
    }),
  },
};
</script>

<style scoped lang="less">
* {
  box-sizing: border-box;
}
.el-input {
  width: 20%;
}

.body {
  .header {
    width: 100%;
    padding: 10px 20px;
    border-bottom: 1px solid rgb(210, 210, 210);
  }
  .lists {
    width: 100%;
    margin: 10px 0px;
    .list {
      // width: 100%;
      padding: 10px;
      margin: 10px;
      height: 100px;
      background-color: rgb(213, 213, 250);
      border-radius: 5px;
      &:hover{
        box-shadow: 1px 1px 8px 1px gray;
        cursor: pointer;
      }
      div{
        height: 30px;
        line-height: 30px;
        span {
          padding: 0px 20px;
          margin: 0px 20px;
          border-radius: 10px;
          background-color: aliceblue;
        }
      }
    }
  }
}
</style>